<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>员工档案添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../layuimini/css/public.css" media="all">
</head>
<body>
<form method="post" class="layui-form" action="">
    <div th:each="d:${employeeInfo}">
        <div class="layui-form-item">
            <input type="hidden" name="id" th:value="${d.id}">
            <div class="layui-inline">
                <label class="layui-form-label">用户姓名</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" th:value="${d.employeeInfo.empName}" class="layui-input">
                </div>
            </div>
            <br/>
            <div class="layui-inline">
                <label class="layui-form-label">计划主题</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" th:value="${d.theme}" class="layui-input">
                </div>
            </div>
            <br/>
            <div class="layui-inline">
                <label class="layui-form-label">计划内容</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" th:value="${d.content}" class="layui-input">
                </div>
            </div>
            <br/>
            <div class="layui-inline">
                <label class="layui-form-label">开始时间</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" lay-verify="required" th:value="${d.start}" class="layui-input">
                </div>
            </div>
            <br/>
            <div class="layui-inline">
                <label class="layui-form-label">结束时间</label>
                <div class="layui-input-inline">
                    <input type="text" readonly="readonly" lay-verify="required" th:value="${d.end}" class="layui-input">
                </div>
            </div>
            <br/>
            <div class="layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-inline">
                    <select name="state" class="layui-input"  >
                        <option value="13">已通过</option>
                        <option value="12">未通过</option>
                    </select>
                </div>
            </div>
            <br/>
            <div class="layui-inline">
                <label class="layui-form-label">驳回原因</label>
                <div class="layui-input-inline">
                    <textarea name="bohuiText" style="width: 190px;height: 80px" th:text="${d.bohuiText}"></textarea>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">审批</button>
            </div>
        </div>
    </div>
</form>
<script src="../layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>

    layui.use(['form'], function () {
        var $ = layui.jquery;
        var form = layui.form;
        var table = layui.table;
        //监听提交
        form.on('submit(saveBtn)', function (data) {
            console.log(data.field);
            $.post('/plan/update',data.field,function(res){
                if(res.data==="success"){
                    var iframeIndex = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(iframeIndex);
                    parent.layui.table.reload('table-user');
                    parent.layer.msg(res.msg);
                }
            })
            return false;
        });
    });
</script>
</body>
</html>